<template>
    <div>
        <el-card>
            <div class="bindTitle">已封禁的IP</div>
            <el-input class="input" type="textarea" :rows="10" v-model="key1" placeholder="请输入IP"></el-input>
            <br>
            <el-button type="primary" class="fanhuiBtn" @click="tosend">保存</el-button>
        </el-card>
    </div>
</template>

<script>
export default {
    data() {
        return {
            key1:''
        }
    },
    methods:{
        tosend(){
			this.getData('set')
        },
        getData(type){
            var send = {
				content:this.key1,
				type:type
			}
            this.$http.post('getbanIp',send).then((data)=>{
                if(data.data.success){
                   var num = data.data.msg.length;
                   if ( num>1 ) this.$message({
						showClose: true,
						message: data.data.msg,
						type: 'success',
						offset:'65',
						duration:1000
				   });
				   this.key1 = data.data.data.ip
                }else{
                    this.$message.error(data.data.msg)
                }
            })
        }
    },
    created(){
		this.getData('get')
    }
}
</script>

<style scoped>
.el-card{
    margin: 8px;
}
.bindTitle{
    margin: 25px 0;
}
textarea{
    width: 600px;
    height: 320px;
    padding: 10px;
    font-size: 18px;
    margin-bottom: 80px;
}
.input{
    width: 600px;
}
.fanhuiBtn{
    margin: 30px 0 0;
}
</style>